<script setup lang="ts">
import { RouterView } from 'vue-router'
import { ElMenu, ElMenuItem, ElContainer, ElHeader, ElMain, ElFooter } from 'element-plus'
</script>

<template>
  <ElContainer class="layout-container">
    <ElHeader class="custom-header">
     <div class="logo">Eye-Disease-Analysis</div>
      <ElMenu
        mode="horizontal"
        :default-active="$route.path"
        background-color="transparent"
        text-color="#fff"
        active-text-color="#ffd04b"
        router
        class="menu-right"
      >
        <ElMenuItem index="/">首页</ElMenuItem>
        <ElMenuItem index="/upload">眼部疾病在线检测</ElMenuItem>
      </ElMenu>
    </ElHeader>

    <ElMain class="custom-main">
      <RouterView />
    </ElMain>

    <ElFooter class="custom-footer">
      <div class="footer">
        <p>精准捕捉眼部微光，让每一处病变无所遁形</p>
      </div>
    </ElFooter>
  </ElContainer>
</template>

<style scoped>
.layout-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, #f5f7fa 0%, #e4ecf5 100%);
}

/* 新增：让菜单居右 */
.menu-right {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

/* 头部导航定制 */
.custom-header {
  padding: 0;
  /* 渐变背景增强科技感，可根据喜好调整 */
  background: linear-gradient(90deg, #36cd6e 0%, #30c4b0 100%); 
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.logo {
  float: left;
  color: #fff;
  font-size: 20px;
  font-weight: bold;
  line-height: 60px; 
  margin: 0 40px 0 15px; 
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* 主导航菜单项 hover 动效（可选增强） */
.el-menu-item:hover {
  transform: translateY(-2px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 主要内容区域 */
.custom-main {
  flex: 1;
  padding: 10px 20px;
  /* 让内容区域有个浅层级卡片感，突出中间内容 */
  background: #fff; 
  margin: 6px 12px; 
  border-radius: 12px; 
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.05); 
}

/* 底部区域定制 */
.custom-footer {
  text-align: center;
  padding: 20px 0;
  background: #fff; 
  border-top: 1px solid #eee; 
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.03); 
}

.footer p {
  margin: 5px 0;
  color: #333; 
  font-family: "Microsoft YaHei";
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
</style>